//class HtmlDebugUtils
    
    export  class HtmlDebugUtils
    {
        

        public static htmlTrace(arg1: string): void
        {
            HtmlDebugUtils.call("traceToJs", arg1);
            return;
        }

        public static addCallback(arg1: string, arg2: Function): void
        {
            try 
            {
                flash.external.ExternalInterface.addCallback(arg1, arg2);
            }
            catch (e)
            {
            };
            return;
        }

        /* internal  */static init(): void
        {
            var loc1="traceToJs(str){" + "if(console && console.log){" + "console.log(str);" + "}" + "}";
            HtmlDebugUtils.call("eval", loc1);
            return;
        }

        public static call(arg1: string, ... rest): Object
        {
            var loc1=null;
            var loc2=null;
            if (!HtmlDebugUtils.hasInit) 
            {
                HtmlDebugUtils.hasInit = true;
                HtmlDebugUtils.init();
            }
            try 
            {
                loc3 = rest.length;
                switch (loc3) 
                {
                    case 0:
                    {
                        loc1 = flash.external.ExternalInterface.call(arg1);
                        break;
                    }
                    case 1:
                    {
                        loc1 = flash.external.ExternalInterface.call(arg1, rest[0]);
                        break;
                    }
                    case 2:
                    {
                        loc1 = flash.external.ExternalInterface.call(arg1, rest[0], rest[1]);
                        break;
                    }
                    case 3:
                    {
                        loc1 = flash.external.ExternalInterface.call(arg1, rest[0], rest[1], rest[2]);
                        break;
                    }
                    case 4:
                    {
                        loc1 = flash.external.ExternalInterface.call(arg1, rest[0], rest[1], rest[2], rest[3]);
                        break;
                    }
                    case 5:
                    {
                        loc1 = flash.external.ExternalInterface.call(arg1, rest[0], rest[1], rest[2], rest[3], rest[4]);
                        break;
                    }
                    default:
                    {
                        (loc2 = flash.external.ExternalInterface.call).apply(flash.external.ExternalInterface, HtmlDebugUtils.getParamArr(arg1, rest));
                    }
                }
            }
            catch (e)
            {
            };
            return loc1;
        }

        /* internal  */static getParamArr(arg1: string, arg2: Array<any>): Array<any>
        {
            var loc1=arg2;
            if (loc1 == null) 
            {
                loc1 = new Array<any>();
            }
            loc1.unshift(arg1);
            return loc1;
        }

        public static /* var */hasInit: Boolean=false;
    }

            HtmlDebugUtils.hasInit = false;
        